import VueRouter from 'vue-router'
import HomePage from '../pages/Home'



const router = new VueRouter({
    routes: [
        {
            path: '/',
            component: HomePage,
        },
        {
            path: '/on-line',
            name: 'on-line',
            component: () => import('@/pages/monitor/on-line.vue')
        },
        {
            path: '/real-time',
            name: 'real-time',
            component: () => import('@/pages/monitor/real-time.vue')
        },
        {
            path: '/information-base',
            name: 'information-base',
            component: () => import('@/pages/DiseaseBase/information-base.vue')
        },
        {
            path: '/cure',
            name: 'cure',
            component: () => import('@/pages/DiseaseBase/cure.vue')
        },

        {
            path: '/overview',
            name: 'overview',
            component: () => import('@/pages/data-vision/overview.vue')
        },
        {
            path: '/resource',
            name: 'resource',
            component: () => import('@/pages/data-vision/resource.vue')
        },

        {
            path: '/record',
            name: 'record',
            component: () => import('@/pages/record.vue')
        },
    ]
})


//设置了路由守卫（作用：在用户登录之前无法进入那些需要用户个人数据的页面）
// router.beforeEach((to,from,next) => {
//     if(to.path === '/monitoringPage' || to.path === '/libraryPage/treatNav' || to.path === '/minePage'){
//         if(user === null){
//             console.log('请先登录后在查看此页',from)
//         }else{
//             next()
//         }
//     }else{
//         next()
//     }
// })
export default router
